package com.baizhi.servlet;

import com.baizhi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {

    @Autowired
    private UserService userService;



    //增
    public void registUser(){

        userService.addUser(1,"张三",17,"北京海淀");
    }

    //删
    public void delUser(){
        userService.removeUser();
    }


    //改
    public void updateUser(){
        userService.updateUser();
    }


    //根据Id查询
    public void getUserById(){
        userService.findUserById();
    }


    //全查
    public void getUsers(){
        userService.findUser();
    }
}
